﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_GetUser')
	BEGIN
		DROP  Procedure esf_sso.P_GetUser
	END

GO

-- esf_sso.P_GetUser 1, 'root'

CREATE Procedure esf_sso.P_GetUser
	@pPersonID	INT = NULL
	,@pAlias	VARCHAR (20) = NULL
AS

	SET NOCOUNT ON;
	
	
	SELECT 
		VU.*
	FROM 
		esf_sso.[VUser] VU
	WHERE
		VU.Usr_Per_ID = @pPersonID
		OR VU.Usr_Alias = @pAlias

GO